<template>
	<div id="selectiveRecipient">
        <AccepterOfGener v-if="judge == 'AccepterOfGener'"></AccepterOfGener>
		<Accepter v-if="judge == 'Accepter'" :data="data"></Accepter>
	</div>
</template>

<script>
import AccepterOfGener from './AccepterOfGener.vue'
import Accepter from './Accepter'
export default {
	name: "selectiveRecipient",

	data() {
		return {
			params:{},
			judge:'AccepterOfGener',
			data: {}
		};
	},

	beforeCreate() {},

	created() {
		this.params = this.$store.getters.getData;
		console.log("parms--",this.params);
		this.loadData();
	},

	methods: {
		// 获取数据
		loadData() {
			debugger
			var handler = new this.HttpHandler("BP.WF.HttpHandler.WF_WorkOpt");
            handler.AddJson(this.params); //这里是获得Url的参数.
            var data = handler.DoMethodReturnString("Accepter_Init");
			if(data.indexOf("err@")!=-1){
				this.$message.error(data.replace("err@",""));
				console.log(data);
				return;
			}
			if(data.indexOf("AccepterOfGener") != -1){
				console.log("AccepterOfGener");
				this.judge = "AccepterOfGener";
			}else{
				console.log("Accepter");
				this.judge = "Accepter";
				this.data = JSON.parse(data);
			}

		},

		onSubmit(val) {
			console.log("val",val);
		},
		handleNodeClick(){},
	},

	//监听
	computed: {},

	components: {
		AccepterOfGener,
		Accepter
	},

	//监听后执行动作
	watch: {}
};
</script>

<style lang="less" scoped>
/deep/ .el-dialog__body{
	padding: 10px 20px;
}
</style>